package main

import "fmt"

//用时8ms 94%,内存6mb 100%
func countHomogenous(s string) (res int) {
	const mod int = 1e9 + 7
	prev := rune(s[0])
	cnt := 0
	for _, c := range s {
		if c == prev {
			cnt++
		} else {
			res += (cnt + 1) * cnt / 2
			cnt = 1
			prev = c
		}
	}
	res += (cnt + 1) * cnt / 2
	return res % mod
}

func main() {
	s := "sdsddsFs"
	fmt.Println(countHomogenous(s))
	fmt.Printf("%f", 2.1e10)
}
